import request from '@/utils/request';

export async function getPlantCapacityCalendarByPage(params: any) {
  return request('/api/product/getPlantCapacityCalendarByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addPlantCapacityCalendar(params: any) {
  return request('/api/product/addPlantCapacityCalendar', {
    method: 'POST',
    data: params,
  });
}

export async function updatePlantCapacityCalendar(params: any) {
  return request('/api/product/updatePlantCapacityCalendar', {
    method: 'POST',
    data: params,
  });
}

export async function delPlantCapacityCalendar(params: any) {
  return request('/api/product/delPlantCapacityCalendar', {
    method: 'POST',
    data: params,
  });
}

export async function exportPlantCapacityCalendar(params: any) {
  return request('/api/product/exportPlantCapacityCalendar', {
    method: 'POST',
    data: params,
    responseType: 'blob',
  });
}

// 获取工序
export async function getAllProcess(params: any) {
  return request('/api/design/getAllProcess', {
    method: 'POST',
    data: params,
  });
}

// 获取指定天数内的产能
export async function getAllPlantCapacityCalendar(params: any) {
  return request('/api/product/getAllPlantCapacityCalendar', {
    method: 'POST',
    data: params,
  });
}

// 获取工序的基础产能（横线数据）
export async function getPlantCapacityBase(para: any) {
  return request('/api/product/getPlantCapacityBase', {
    method: 'POST',
    data: para,
    params:{
      processId:para.processId,
    }
  });
}

export default {
  getPlantCapacityCalendarByPage,
  addPlantCapacityCalendar,
  updatePlantCapacityCalendar,
  delPlantCapacityCalendar,
  exportPlantCapacityCalendar,
};
